#include <ros/ros.h>
#include <std_msgs/String.h>
#include <sstream>

int main(int argc, char *argv[])
{
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "demo01_pub");
    
    ros::NodeHandle nh;

    ros::Publisher pub = nh.advertise<std_msgs::String>("Hourse", 10);

    std_msgs::String msg;
    int count = 0;
    ros::Rate rate(1);
    
    ros::Duration(3).sleep();

    while (ros::ok()) {
        count++;
        //msg.data = "hello";
        std::stringstream ss;
        ss << "hello " << count;
        msg.data = ss.str();
        pub.publish(msg);
        ROS_INFO("pub %s", ss.str().c_str());
        ros::spinOnce();
        rate.sleep();
    }


    return 0;
}